package mall.service;

import java.util.List;

import mall.dao.CategoryDAO;
import mall.pojo.Category;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class CategoryServiceImpl implements CategoryService {

	@Autowired
	private CategoryDAO categoryDAO;

	@Override
	@Transactional
	public List<Category> getCategoryShop(int shopId) {
		return (List<Category>)categoryDAO.getCategoryShop(shopId);
	}

	@Override
	@Transactional
	public List<Category> getListCategory() {
		return (List<Category>)categoryDAO.getListCategory();
	}

	@Override
	@Transactional
	public void createCategory(Category category) {
		categoryDAO.createCategory(category);
	}

	@Override
	@Transactional
	public Category getCategory(int catId) {	
		return categoryDAO.getCategory(catId);
	}

	@Override
	@Transactional
	public int updateCategory(Category category) {
		return categoryDAO.updateCategory(category);
	}
	

}
